#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QPushButton>
#include <QFontDialog>
#include <QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QPushButton* btn = new QPushButton(this);

    connect(btn, &QPushButton::clicked, [=](){
        bool flag;
        QFont font = QFontDialog::getFont(&flag);

        qDebug() << "字体：" << font.family().toUtf8().data();
        qDebug() << "字号：" << font.pointSize();
        qDebug() << "是否加粗：" << font.bold();
        qDebug() << "是否倾斜：" << font.italic();
    });
}

MainWindow::~MainWindow()
{
    delete ui;
}

